<?php

#dont use Route::resource!!!

Route::group(array('prefix' => 'acc', 'before' => 'auth'), function()
{
    Route::group(array('prefix' => 'master'), function()
    {
        # Master Code Management
        Route::get('code',            array('as'=>'acc.master.code.index',   'uses'=>'nimo\domains\acc\controllers\MasterCodeController@index'));
        Route::get('code-create',     array('as'=>'acc.master.code.create',  'uses'=>'nimo\domains\acc\controllers\MasterCodeController@create'));
        Route::post('code',           array('as'=>'acc.master.code.store',   'uses'=>'nimo\domains\acc\controllers\MasterCodeController@store'));
        Route::get('code/{id}',       array('as'=>'acc.master.code.show',    'uses'=>'nimo\domains\acc\controllers\MasterCodeController@show'));
        Route::get('code/{id}/edit',  array('as'=>'acc.master.code.edit',    'uses'=>'nimo\domains\acc\controllers\MasterCodeController@edit'));
        Route::patch('code/{id}',     array('as'=>'acc.master.code.update',  'uses'=>'nimo\domains\acc\controllers\MasterCodeController@update'));
        Route::delete('code/{id}',    array('as'=>'acc.master.code.destroy', 'uses'=>'nimo\domains\acc\controllers\MasterCodeController@destroy'));
        Route::get('code/{id}/up',    array('as'=>'acc.master.code.up',      'uses'=>'nimo\domains\acc\controllers\MasterCodeController@up'));
        Route::get('code/{id}/down',  array('as'=>'acc.master.code.down',    'uses'=>'nimo\domains\acc\controllers\MasterCodeController@down'));

        Route::get('code-search',     array('as'=>'acc.master.code.search',  'uses'=>'nimo\domains\acc\controllers\CodeController@search'));
        Route::match(array('GET', 'POST'), 'code-import', array('as'=>'acc.master.code.import',  'uses'=>'nimo\domains\acc\controllers\MasterCodeBatchController@import'));
    });

    Route::group(array('prefix' => 'book'), function()
    {
        # Entry Book
        Route::get('entry',            array('as'=>'acc.book.entry.index',   'uses'=>'nimo\domains\acc\controllers\BookEntryController@index'));
        Route::get('entry-create',     array('as'=>'acc.book.entry.create',  'uses'=>'nimo\domains\acc\controllers\BookEntryController@create'));
        Route::post('entry',           array('as'=>'acc.book.entry.store',   'uses'=>'nimo\domains\acc\controllers\BookEntryController@store'));
        Route::get('entry/{id}',       array('as'=>'acc.book.entry.show',    'uses'=>'nimo\domains\acc\controllers\BookEntryController@show'));
        Route::get('entry/{id}/edit',  array('as'=>'acc.book.entry.edit',    'uses'=>'nimo\domains\acc\controllers\BookEntryController@edit'));
        Route::patch('entry/{id}',     array('as'=>'acc.book.entry.update',  'uses'=>'nimo\domains\acc\controllers\BookEntryController@update'));
        Route::delete('entry/{id}',    array('as'=>'acc.book.entry.destroy', 'uses'=>'nimo\domains\acc\controllers\BookEntryController@destroy'));

        Route::match(array('GET', 'POST'), 'entry-import', array('as'=>'acc.entry.book.import',  'uses'=>'nimo\domains\acc\controllers\TBookBatchController@import'));
    });

});
